/**
 * === QuickTime Utility ===
 *  Unit Name:  QTC_MediaHandler
 *  Author:     Lincoln Yu
 *  Purpose:    Base class of QuickDraw Media-handler object
 * == History ==        
 *	2006-01-25:	Created.
 * == Statements ==
 *  Copyright 2005 HDIC. All rights reserved.
 *
 */

#ifndef	_QTC_MediaHandler_H
#define	_QTC_MediaHandler_H

#include <qul/quicktime/base6/QTC_Base.h>


#ifdef __cplusplus

_QTC_BEGIN

class MediaHandler : public BaseComponent
	{
public:

	MediaHandler(StoragePtr pStorage) : BaseComponent(pStorage) {}
	virtual ~MediaHandler() {}

// Core Selector Range

	virtual Result Target (ComponentInstance ciTarget) { return 0; }
	virtual Result Register () { return 0; }
	virtual Result Version () { return 0; }
	// Place reserved for [:CanDo:] ...
	virtual Result Close (ComponentInstance ciSelf) { return 0; }
	virtual Result Open (ComponentInstance ciSelf) { return 0; }

// Derived Media-handler Range

	virtual Result Initialize (GetMovieCompleteParams *pGMC) { return 0; }
	virtual Result Idle (TimeValue timeMedia, long flagsIn, 
		long *pFlagsOut, const TimeRecord *pTimeMovie) { return 0; }
	virtual Result GetMediaInfo (Handle h) { return 0; }
	// Place reserved for [:PutMediaInfo:] ...
	virtual Result SetActive (Boolean mediaEnable) { return 0; }
	virtual Result SetRate (Fixed rate) { return 0; }
	// Place reserved for [:GGetStatus:] ...
	virtual Result TrackEdited () { return 0; }
	// Place reserved for [:SetMediaTimeScale:] ...
	// Place reserved for [:SetMovieTimeScale:] ...
	virtual Result SetGWorld (CGrafPtr port, GDHandle gd) { return 0; }
	virtual Result SetDimensions (Fixed width, Fixed height) { return 0; }
	// Place reserved for [:SetClip:] ...
	virtual Result SetMatrix (MatrixRecord *pMatrix) { return 0; }
	// Place reserved for [:GetTrackOpaque:] ...
	// Place reserved for [:SetGraphicsMode:] ...
	// Place reserved for [:GetGraphicsMode:] ...
	// Place reserved for [:GSetVolume:] ...
	// Place reserved for [:SetSoundBalance:] ...
	// Place reserved for [:GetSoundBalance:] ...
	// Place reserved for [:GetNextBoundsChange:] ...
	// Place reserved for [:GetSrcRgn:] ...
	// Place reserved for [:Preroll:] ...
	virtual Result SampleDescriptionChanged (long index) { return 0; }
	virtual Result HasCharacteristic (OSType characteristic, Boolean *pHasIt) { return 0; }
	// Place reserved for [:HasCharacteristic:] ...
	// Place reserved for [:GetOffscreenBufferSize:] ...
	// Place reserved for [:SetHints:] ...
	// Place reserved for [:GetName:] ...
	// Place reserved for [:ForceUpdate:] ...
	// Place reserved for [:GetDrawingRgn:] ...
	// Place reserved for [:GSetActiveSegment:] ...
	// Place reserved for [:InvalidateRegion:] ...
	// Place reserved for [:GetNextStepTime:] ...
	// Place reserved for [:SetNonPrimarySourceData:] ...
	// Place reserved for [:ChangedNonPrimarySource:] ...
	// Place reserved for [:TrackReferencesChanged:] ...
	// Place reserved for [:GetSampleDataPointer:] ...
	// Place reserved for [:ReleaseSampleDataPointer:] ...
	// Place reserved for [:TrackPropertyAtomChanged:] ...
	// Place reserved for [:SetTrackInputMapReference:] ...
	// Place reserved for [:SetVideoParam:] ...
	// Place reserved for [:GetVideoParam:] ...
	// Place reserved for [:Compare:] ...
	// Place reserved for [:GetClock:] ...
	// Place reserved for [:SetSoundOutputComponent:] ...
	// Place reserved for [:GetSoundOutputComponent:] ...
	// Place reserved for [:SetSoundLocalizationData:] ...
	// Place reserved for [:GetInvalidRegion:] ...
	virtual Result SampleDescriptionB2N (SampleDescriptionHandle hDesc) { return 0; }
	virtual Result SampleDescriptionN2B (SampleDescriptionHandle hDesc) { return 0; }
	// Place reserved for [:QueueNonPrimarySourceData:] ...
	// Place reserved for [:FlushNonPrimarySourceData:] ...
	// Place reserved for [:GetURLLink:] ...
	// Place reserved for [:MakeMediaTimeTable:] ...
	// Place reserved for [:HitTestForTargetRefCon:] ...
	// Place reserved for [:HitTestTargetRefCon:] ...
	// Place reserved for [:GetActionsForQTEvent:] ...
	// Place reserved for [:DisposeTargetRefCon:] ...
	// Place reserved for [:TargetRefConsEqual:] ...
	// Place reserved for [:SetActionsCallback:] ...
	// Place reserved for [:PrePrerollBegin:] ...
	// Place reserved for [:PrePrerollCancel:] ...
	// Place reserved for [:EnterEmptyEdit:] ...
	// Place reserved for [:CurrentMediaQueuedData:] ...
	// Place reserved for [:GetEffectiveVolume:] ...
	// Place reserved for [:ResolveTargetRefCon:] ...
	// Place reserved for [:GetSoundLevelMeteringEnabled:] ...
	// Place reserved for [:SetSoundLevelMeteringEnabled:] ...
	// Place reserved for [:GetSoundLevelMeterInfo:] ...
	// Place reserved for [:GetEffectiveSoundBalance:] ...
	// Place reserved for [:SetScreenLock:] ...
	// Place reserved for [:SetDoMCActionCallback:] ...
	// Place reserved for [:GetErrorString:] ...
	// Place reserved for [:GetSoundEqualizerBands:] ...
	// Place reserved for [:SetSoundEqualizerBands:] ...
	// Place reserved for [:GetSoundEqualizerBandLevels:] ...
	// Place reserved for [:DoIdleActions:] ...
	// Place reserved for [:SetSoundBassAndTreble:] ...
	// Place reserved for [:GetSoundBassAndTreble:] ...

	};	// class MediaHandler

_QTC_END

#endif	// ifdef __cplusplus

#ifdef __cplusplus
extern "C" {
#endif

//////////////////////////////////////////////////////////////////////////
// Core Selector Range

QTC_Result QTC_MediaHandler_Target (void *pUnk, ComponentInstance ciTarget);
QTC_Result QTC_MediaHandler_Register (void *pUnk);
QTC_Result QTC_MediaHandler_Version (void *pUnk);
// Place reserved for [:CanDo:] ...
QTC_Result QTC_MediaHandler_Close (void *pUnk, ComponentInstance ciSelf);
QTC_Result QTC_MediaHandler_Open (void *pUnk, ComponentInstance ciSelf);

//////////////////////////////////////////////////////////////////////////
// Derived Media-handler Range

QTC_Result QTC_MediaHandler_Initialize (void *pUnk, GetMovieCompleteParams *pGMC);
QTC_Result QTC_MediaHandler_Idle (void *pUnk, TimeValue timeMedia, long flagsIn, 
	long *pFlagsOut, const TimeRecord *pTimeMovie);
QTC_Result QTC_MediaHandler_GetMediaInfo(void *pUnk, Handle h);
// Place reserved for [:PutMediaInfo:] ...
QTC_Result QTC_MediaHandler_SetActive (void *pUnk, Boolean mediaEnable);
QTC_Result QTC_MediaHandler_SetRate (void *pUnk, Fixed rate);
// Place reserved for [:GGetStatus:] ...
QTC_Result QTC_MediaHandler_TrackEdited (void *pUnk);
// Place reserved for [:SetMediaTimeScale:] ...
// Place reserved for [:SetMovieTimeScale:] ...
QTC_Result QTC_MediaHandler_SetGWorld (void *pUnk, CGrafPtr port, GDHandle gd);
QTC_Result QTC_MediaHandler_SetDimensions (void *pUnk, Fixed width, Fixed height);
// Place reserved for [:SetClip:] ...
QTC_Result QTC_MediaHandler_SetMatrix (void *pUnk, MatrixRecord *pMatrix);
// Place reserved for [:GetTrackOpaque:] ...
// Place reserved for [:SetGraphicsMode:] ...
// Place reserved for [:GetGraphicsMode:] ...
// Place reserved for [:GSetVolume:] ...
// Place reserved for [:SetSoundBalance:] ...
// Place reserved for [:GetSoundBalance:] ...
// Place reserved for [:GetNextBoundsChange:] ...
// Place reserved for [:GetSrcRgn:] ...
// Place reserved for [:Preroll:] ...
QTC_Result QTC_MediaHandler_SampleDescriptionChanged (void *pUnk, long index);
QTC_Result QTC_MediaHandler_HasCharacteristic (void *pUnk, OSType characteristic, Boolean *pHasIt);
// Place reserved for [:GetOffscreenBufferSize:] ...
// Place reserved for [:SetHints:] ...
// Place reserved for [:GetName:] ...
// Place reserved for [:ForceUpdate:] ...
// Place reserved for [:GetDrawingRgn:] ...
// Place reserved for [:GSetActiveSegment:] ...
// Place reserved for [:InvalidateRegion:] ...
// Place reserved for [:GetNextStepTime:] ...
// Place reserved for [:SetNonPrimarySourceData:] ...
// Place reserved for [:ChangedNonPrimarySource:] ...
// Place reserved for [:TrackReferencesChanged:] ...
// Place reserved for [:GetSampleDataPointer:] ...
// Place reserved for [:ReleaseSampleDataPointer:] ...
// Place reserved for [:TrackPropertyAtomChanged:] ...
// Place reserved for [:SetTrackInputMapReference:] ...
// Place reserved for [:SetVideoParam:] ...
// Place reserved for [:GetVideoParam:] ...
// Place reserved for [:Compare:] ...
// Place reserved for [:GetClock:] ...
// Place reserved for [:SetSoundOutputComponent:] ...
// Place reserved for [:GetSoundOutputComponent:] ...
// Place reserved for [:SetSoundLocalizationData:] ...
// Place reserved for [:GetInvalidRegion:] ...
QTC_Result QTC_MediaHandler_SampleDescriptionB2N (void *pUnk, SampleDescriptionHandle hDesc);
QTC_Result QTC_MediaHandler_SampleDescriptionN2B (void *pUnk, SampleDescriptionHandle hDesc);
// Place reserved for [:QueueNonPrimarySourceData:] ...
// Place reserved for [:FlushNonPrimarySourceData:] ...
// Place reserved for [:GetURLLink:] ...
// Place reserved for [:MakeMediaTimeTable:] ...
// Place reserved for [:HitTestForTargetRefCon:] ...
// Place reserved for [:HitTestTargetRefCon:] ...
// Place reserved for [:GetActionsForQTEvent:] ...
// Place reserved for [:DisposeTargetRefCon:] ...
// Place reserved for [:TargetRefConsEqual:] ...
// Place reserved for [:SetActionsCallback:] ...
// Place reserved for [:PrePrerollBegin:] ...
// Place reserved for [:PrePrerollCancel:] ...
// Place reserved for [:EnterEmptyEdit:] ...
// Place reserved for [:CurrentMediaQueuedData:] ...
// Place reserved for [:GetEffectiveVolume:] ...
// Place reserved for [:ResolveTargetRefCon:] ...
// Place reserved for [:GetSoundLevelMeteringEnabled:] ...
// Place reserved for [:SetSoundLevelMeteringEnabled:] ...
// Place reserved for [:GetSoundLevelMeterInfo:] ...
// Place reserved for [:GetEffectiveSoundBalance:] ...
// Place reserved for [:SetScreenLock:] ...
// Place reserved for [:SetDoMCActionCallback:] ...
// Place reserved for [:GetErrorString:] ...
// Place reserved for [:GetSoundEqualizerBands:] ...
// Place reserved for [:SetSoundEqualizerBands:] ...
// Place reserved for [:GetSoundEqualizerBandLevels:] ...
// Place reserved for [:DoIdleActions:] ...
// Place reserved for [:SetSoundBassAndTreble:] ...
// Place reserved for [:GetSoundBassAndTreble:] ...

#ifdef __cplusplus
}
#endif

#endif	// ifndef _QTC_MediaHandler_H
